Overview
These utilities modify the geospatial metadata and registration of equirectangular (and similar cylindrical) projections without resampling image data. This approach:- ✅ Preserves original pixel values exactly
- ✅ Avoids interpolation artifacts
- ✅ Executes rapidly (no pixel processing)
- ⚠️ Only works for specific projection types
NewCenterLon_Equi.py
Changes the center longitude (central meridian) without reprojecting.Usage
string
default:"GTiff"
Output format (GDAL driver name: GTiff, HFA, ISIS3, etc.)
float
required
New center longitude value in decimal degrees
string
required
Path to input raster file
string
required
Path to output raster file
Examples
How It Works
1
Read projection information
Extract the current spatial reference system and geotransformation matrix
2
Calculate longitude offset
Determine the shift in X coordinates based on center longitude change:
3
Update geotransform
Modify the X origin in the geotransformation matrix without touching pixel data
4
Update projection WKT
Change the
central_meridian parameter in the projection definition5
Write output
Copy pixel data unchanged, apply new geotransform and projection
Use Cases
Global Map Conventions
Convert between -180° to 180° and 0° to 360° longitude systems
Seam Repositioning
Move the map edge seam to a different longitude
Regional Centering
Center the map on a specific feature or region of interest
Multi-Body Data
Standardize center longitude across planetary datasets
NewStandardPar_Equi.py
Changes the standard parallel (latitude of true scale) without reprojecting.Usage
string
default:"GTiff"
Output format (GDAL driver name)
float
required
New standard parallel latitude in decimal degrees
string
required
Path to input raster file
string
required
Path to output raster file
Examples
How It Works
1
Calculate scale factor
Determine how X pixel spacing changes with new latitude of true scale:
2
Adjust X resolution
Modify geotransform X pixel size while keeping Y resolution constant
3
Update projection definition
Change
standard_parallel_1 or latitude_of_origin parameter4
Write output
Copy pixel data with updated geotransform (rectangular pixels possible)
Result: The output may have rectangular pixels (different X and Y resolution) because only the X spacing is scaled.
Use Cases
Split Global Mosaics
Prepare latitude bands with appropriate scale for each zone
Regional Processing
Optimize scale distortion for specific latitude ranges
Conformality Adjustment
Match scale characteristics to analysis requirements
Legacy Data Correction
Update old maps with incorrect standard parallel metadata
Example Workflow: Global Lunar Split
The repository includes an example for splitting a global lunar map into 5-degree latitude bands: Files:global_lunar_split_example/NewStandardPar_Equi.pyglobal_lunar_split_example/split_equi_5deg_lat_bands.py
1
Split into latitude bands
Use
gdal_translate to extract 5° latitude strips2
Adjust standard parallel
Apply
NewStandardPar_Equi.py with the central latitude of each band3
Result
Each band has minimal scale distortion at its central latitude
Technical Background
Equirectangular Projection
Also known as Plate Carrée or Simple Cylindrical, this projection maps:λ= longitudeλ₀= center longitude (central meridian)φ= latitudeφ₁= standard parallel (latitude of true scale)R= radius of the sphere/ellipsoid
Why No Resampling Works
Mathematical Explanation
Mathematical Explanation
Equirectangular projection has a linear relationship between pixel coordinates and ground coordinates. Changing the center longitude simply shifts all X coordinates by a constant amount:Similarly, changing standard parallel scales X coordinates uniformly:Because the pixel grid doesn’t need to be warped or rotated, we can simply update the geotransformation coefficients.
Geotransformation Update
Standard GDAL geotransform:geomatrix[0] (ulx)Standard parallel change: Modify
geomatrix[1] (xres)
Requirements
- Modern GDAL Python bindings:
from osgeo import gdal - Legacy bindings:
import gdal
Supported Output Formats
Common GDAL format codes for-of parameter:
GTiff
GeoTIFF (default)
HFA
Erdas Imagine .img
ISIS3
USGS ISIS3 cube
ENVI
ENVI .dat + .hdr
AAIGrid
Arc/Info ASCII Grid
JPEG
JPEG (loses georeferencing)
gdal_translate --formats for full list.
Validation
After running these scripts, verify the output:1
Check projection parameters
2
Verify corner coordinates
3
Test coordinate transformation
Use
gdallocationinfo to verify pixel-to-ground coordinate mapping4
Visual inspection
Open in QGIS or other GIS software with graticule overlay
Credits
Author: Trent Hare, USGSBased on: tolatlong.py by Andrey Kiselev (dron@remotesensing.org)
Project: Lunar Mapping and Modeling Project (LMMP)
These scripts were developed for planetary mapping workflows but work equally well for terrestrial data in appropriate projections.